const express = require('express');

const router = express.Router();

router.get('/get', (req, res) => {
  console.log('呵呵哒。。。');
  const { query } = req;
  res.send('sayHi(123, 456)');
  res.send({
    code: 0,
    msg: 'ok',
    data: query,
  });
});

router.post('/post', express.urlencoded(), express.json(), (req, res) => {
  const { body } = req;
  res.send({
    code: 0,
    msg: 'ok',
    data: body,
  });
});

router.put('/put', (req, res) => {
  res.send({
    code: 0,
    msg: 'ok',
  });
});

module.exports = router;
